﻿
@{
    ViewBag.Title = "DataAnalysis";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}

@section css{
    <style>
        .bg-light th {
            font-weight: bolder;
            text-align: center;
        }

        a {
            text-decoration: none;
            color: white;
        }

            a:hover {
                text-decoration: none;
                color: white;
            }

            a:after {
                text-decoration: none;
                color: white;
            }
    </style>
}
<header id="topbar">
    <div class="topbar-left">
        <ol class="breadcrumb">
            <li class="crumb-active">
                <a>数据总览</a>
            </li>
            <li class="crumb-trail">职业健康</li>
        </ol>
    </div>
</header>
<section id="content" class="animated fadeIn" ng-cloak ng-controller="OHSController" ng-init="SearchModel.StartDate='@DateTime.Now.AddYears(-1).ToString("yyyy-01-01")';SearchModel.EndDate='@DateTime.Now.ToString("yyyy-MM-dd")'; LoadDataAnalysis();">
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
			</path>
		</svg>
            <div class="load-msg" ng-bind="LoadingMsg"></div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12 col-lg-12">

            <div class="panel">
                <div class="panel-heading">
                    <span class="panel-title">
                        <span class="glyphicon glyphicon-cog hidden"></span>体检预警
                    </span>
                </div>
                @*<div class="panel-menu p12 admin-form theme-primary">
                        <div class="row">
                            <div class="col-lg-2">
                                <datepicker id="startTime" option="datetimeOption" format="L" ng-model="SearchModel.StartDate"></datepicker>
                            </div>
                            <div class="col-lg-2">
                                <datepicker id="startTime" option="datetimeOption" format="L" ng-model="SearchModel.EndDate"></datepicker>
                            </div>
                        </div>
                    </div>*@
                <div class="panel-body pn">
                    <div class="row mb10" style="margin-top:10px;">
                        <div class="col-md-3">
                            <div class="panel bg-info light of-h mb10">
                                <a data-toggle="modal" href="#YearsCheckModal" ng-click="GetNeedCheckEmployeeList();">
                                    <div class="pn pl20 p5">
                                        <div class="icon-bg"> <i class="fa fa-bar-chart-o"></i> </div>
                                        <h2 class="mt15 lh15"> <b>{{YearCheckCount}}</b> </h2>
                                        <h5 class="text-muted">年度检查</h5>
                                    </div>
                                </a>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="panel bg-danger light of-h mb10">
                                <a data-toggle="modal" href="#ReCheckEmployeeModal" ng-click="ShowCheckWin(ReCheckList);">
                                    <div class="pn pl20 p5">
                                        <div class="icon-bg"> <i class="fa fa-medkit"></i> </div>
                                        <h2 class="mt15 lh15"> <b>{{ReCheckCount}}</b> </h2>
                                        <h5 class="text-muted">当年复查</h5>
                                    </div>
                                </a>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="panel bg-warning light of-h mb10">
                                <a data-toggle="modal" href="#YearsReCheckEmployeeModal" ng-click="ShowCheckWin(YearsReCheckList);">
                                    <div class="pn pl20 p5">
                                        <div class="icon-bg"> <i class="fa fa-user-md"></i> </div>
                                        <h2 class="mt15 lh15"> <b>{{YearsReCheckCount}}</b> </h2>
                                        <h5 class="text-muted">多次复查</h5>
                                    </div>
                                </a>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="panel bg-alert light of-h mb10">
                                <a data-toggle="modal" href="#RetireEmployeeModal" ng-click="ShowCheckWin(RetireList);">
                                    <div class="pn pl20 p5">
                                        <div class="icon-bg"> <i class="fa fa-stethoscope"></i> </div>
                                        <h2 class="mt15 lh15"> <b>{{RetireCount}}</b> </h2>
                                        <h5 class="text-muted">退休检查</h5>
                                    </div>
                                </a>
                            </div>
                        </div>



                    </div>
                </div>
            </div>
        </div>


    </div>

    <div class="row">
        <div class="col-lg-12">
            <div class="panel" id="pchart1">
                <div class="panel-heading">
                    <span class="panel-icon">
                        <i class="fa fa-line-chart"></i>
                    </span>
                    <span class="panel-title">历年体检人次</span>
                </div>
                <div class="panel-body bg-light dark" id="yearscheck" style="height:300px;">

                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-4">
            <div class="panel">
                <div class="panel-heading">
                    <span class="panel-icon">
                        <i class="fa fa-pie-chart"></i>
                    </span>
                    <span class="panel-title">体检结果</span>
                    <div class="widget-menu pull-right mr10">
                        <select type="text" class="form-control" placeholder="Search">
                            <option ng-repeat="x in YearList" value="x">{{x}}</option>
                        </select>
                    </div>
                </div>
                <div class="panel-body bg-light dark" id="resultchart" style="height:300px;">

                </div>
            </div>
        </div>
        <div class="col-lg-4">
            <div class="panel">
                <div class="panel-heading">
                    <span class="panel-icon">
                        <i class="fa fa-pie-chart"></i>
                    </span>
                    <span class="panel-title">体检类型</span>
                    <div class="widget-menu pull-right mr10">
                        <select type="text" class="form-control" placeholder="Search">
                            <option ng-repeat="x in YearList" value="x">{{x}}</option>
                        </select>
                    </div>
                </div>
                <div class="panel-body bg-light dark" id="typechart" style="height:300px;">

                </div>
            </div>
        </div>
        <div class="col-lg-4">
            <div class="panel">
                <div class="panel-heading">
                    <span class="panel-icon">
                        <i class="fa fa-pie-chart"></i>
                    </span>
                    <span class="panel-title">体检参与率</span>
                    <div class="widget-menu pull-right mr10">
                        <select type="text" class="form-control" placeholder="Search">
                            <option ng-repeat="x in YearList" value="x">{{x}}</option>
                        </select>
                    </div>
                </div>
                <div class="panel-body bg-light dark" id="checkratechart" style="height:300px;">

                </div>
            </div>
        </div>

    </div>

    <div class="modal fade" id="YearsCheckModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:1300px;">
            <div class="modal-content" style="min-width: 1380px;">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">需体检人员 总数：{{YearCheckCount}}</h2>
                </div>
                <div class="modal-body" style="max-height:750px; overflow-y:scroll;">
                    <table class="table table-bordered">
                        <thead>
                            <tr class="bg-light">
                                <th>序号</th>
                                <th>工号</th>
                                <th>姓名</th>
                                <th>性别</th>
                                <th>部门</th>
                                <th>车间</th>
                                <th>工种</th>
                                <th>接害因素</th>
                                <th>检查频次</th>
                                <th>上次体检</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-show="LoadData">
                                <td colspan="11">
                                    <img src="~/Assets/images/loading.gif" />
                                     数据量较大，请耐心等候...
                                </td>
                            </tr>
                            <tr ng-show="YearCheckList.length==0 && LoadData==false">
                                <td colspan="11" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                            </tr>
                            <tr ng-repeat="x in YearCheckList">
                                <td style="text-align:center;">
                                    <span ng-bind="$index+1"></span>
                                </td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.EmployeeNo"></td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.EmployeeName"></td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.Gender"></td>
                                <td ng-bind="x.EmployeeInfo.DepartmentName"></td>

                                <td ng-bind="x.EmployeeInfo.WorkSpaceName"></td>
                                <td ng-bind="x.EmployeeInfo.WorkType"></td>
                                <td>{{x.EmployeeInfo.HarmStr}}</td>
                                <td>{{x.EmployeeInfo.CheckInterval}}</td>
                                <td>{{x.LastCheckInfo.CheckDate|JSONDate:'yyyy-MM-dd'}}</td>
                                <td>
                                    <a data-toggle="modal" href="#EditModal" ng-click="" class="btn btn-primary btn-xs btn-label"><i class="fa fa-mail-forward"></i>邮件提醒</a>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <a class="btn btn-primary" href="../OHS/ExportYearNeedCheckEmployee">导出</a>
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btn_close">关闭</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <div class="modal fade" id="RetireEmployeeModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:1080px;">
            <div class="modal-content" style="min-width:1080px;">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">退休需体检人员 总数：{{EmployeeList.length}}</h2>
                </div>
                <div class="modal-body" style="max-height:750px; overflow-y:scroll;">
                    <table class="table table-bordered">
                        <thead>
                            <tr class="bg-light">
                                <th>序号</th>
                                <th>工号</th>
                                <th>姓名</th>
                                <th>性别</th>
                                <th>身份证号</th>
                                <th>部门</th>
                                <th>车间</th>
                                <th>工种</th>
                                <th>最后体检时间</th>
                                <th>退休时间</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-show="EmployeeList.length==0">
                                <td colspan="12" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                            </tr>
                            <tr ng-repeat="x in EmployeeList">
                                <td style="text-align:center;">
                                    <span ng-bind="$index+1"></span>
                                </td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.EmployeeNo"></td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.EmployeeName"></td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.Gender"></td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.IdCardNo"></td>
                                <td ng-bind="x.EmployeeInfo.DepartmentName"></td>

                                <td ng-bind="x.EmployeeInfo.WorkSpaceName"></td>
                                <td ng-bind="x.EmployeeInfo.WorkType"></td>
                                <td style="text-align:center;">{{x.LastCheckInfo.CheckDate|JSONDate:'yyyy-MM-dd'}}</td>
                                <td>{{x.RetireDate|JSONDate:'yyyy-MM-dd'}}</td>
                                <td>
                                    <a data-toggle="modal" href="#EditModal" ng-click="" class="btn btn-primary btn-xs btn-label"><i class="fa fa-mail-forward"></i>邮件提醒</a>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <a type="button" class="btn btn-primary" href="../OHS/ExportRetireList">导出</a>
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btn_close">关闭</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->-
    </div><!-- /.modal -->

    <div class="modal fade" id="ReCheckEmployeeModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:1300px;">
            <div class="modal-content" style="min-width:1080px;">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">当年复查人员 总数：{{EmployeeList.length}}</h2>
                </div>
                <div class="modal-body" style="max-height:750px; overflow-y:scroll;">
                    <table class="table table-bordered">
                        <thead>
                            <tr class="bg-light">
                                <th>序号</th>
                                <th>工号</th>
                                <th>姓名</th>
                                <th>性别</th>
                                <th>身份证号</th>
                                <th>部门</th>
                                <th>车间</th>
                                <th>工种</th>
                                <th>体检时间</th>
                                <th>主检结果</th>
                                <th>主检结论</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-show="EmployeeList.length==0">
                                <td colspan="12" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                            </tr>
                            <tr ng-repeat="x in EmployeeList">
                                <td style="text-align:center;">
                                    <span ng-bind="$index+1"></span>
                                </td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.EmployeeNo"></td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.EmployeeName"></td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.Gender"></td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.IdCardNo"></td>
                                <td ng-bind="x.EmployeeInfo.DepartmentName"></td>

                                <td ng-bind="x.EmployeeInfo.WorkSpaceName"></td>
                                <td ng-bind="x.EmployeeInfo.WorkType"></td>
                                <td style="text-align:center;">{{x.LastCheckInfo.CheckDate|JSONDate:'yyyy-MM-dd'}}</td>
                                <td ng-bind="x.LastCheckInfo.CheckResult"></td>
                                <td ng-bind="x.LastCheckInfo.Conclusion"></td>
                                <td>
                                    <a data-toggle="modal" href="#EditModal" ng-click="" class="btn btn-primary btn-xs btn-label"><i class="fa fa-mail-forward"></i>邮件提醒</a>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <a type="button" class="btn btn-primary" href="../OHS/ExportReCheckEmployee">导出</a>
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btn_close">关闭</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->-
    </div><!-- /.modal -->


    <div class="modal fade" id="YearsReCheckEmployeeModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:1300px;">
            <div class="modal-content" style="min-width:1080px;">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">多年复查人员 总数：{{EmployeeList.length}}</h2>
                </div>
                <div class="modal-body" style="max-height:750px; overflow-y:scroll;">
                    <table class="table table-bordered">
                        <thead>
                            <tr class="bg-light">
                                <th>序号</th>
                                <th>工号</th>
                                <th>姓名</th>
                                <th>性别</th>
                                <th>身份证号</th>
                                <th>部门</th>
                                <th>车间</th>
                                <th>工种</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-show="EmployeeList.length==0">
                                <td colspan="12" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                            </tr>
                            <tr ng-repeat-start="x in EmployeeList">
                                <td style="text-align:center;">
                                    <span ng-bind="$index+1"></span>
                                </td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.EmployeeNo"></td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.EmployeeName"></td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.Gender"></td>
                                <td style="text-align:center;" ng-bind="x.EmployeeInfo.IdCardNo"></td>
                                <td ng-bind="x.EmployeeInfo.DepartmentName"></td>

                                <td ng-bind="x.EmployeeInfo.WorkSpaceName"></td>
                                <td ng-bind="x.EmployeeInfo.WorkType"></td>
                                <td>
                                    <a data-toggle="modal" href="#EditModal" ng-click="" class="btn btn-primary btn-xs btn-label"><i class="fa fa-mail-forward"></i>邮件提醒</a>
                                </td>
                            </tr>
                            <tr ng-repeat-end>
                                <td colspan="9">
                                    <table class="table table-bordered">
                                        <thead>
                                            <tr class="bg-light">
                                                <th>检查时间</th>
                                                <th>主检结果</th>
                                                <th>主检结论</th>
                                            </tr> 
                                        </thead>
                                        <tbody>
                                            <tr ng-repeat="y in x.CheckList">
                                                <td style="text-align:center;">{{y.CheckDate|JSONDate:'yyyy-MM-dd'}}</td>
                                                <td style="text-align:center;" ng-bind="y.CheckResult"></td>
                                                <td style="text-align:center;" ng-bind="y.Conclusion"></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <a href="../OHS/ExportYearsReCheckEmployee" class="btn btn-primary">导出</a>
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btn_close">关闭</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->-
    </div><!-- /.modal -->
</section>
@section Js{
    <script src="~/Bussiness/js/libs/echarts.min.js"></script>
    <script src="~/bussiness/js/pg/OHS.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/bussiness/js/libs/moment.min.js"></script>
    <script src="~/bussiness/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/bussiness/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/bussiness/js/libs/angularjs-datepicker.js"></script>
    <script src="~/bussiness/js/libs/fileinput.js"></script>
    <script src="~/bussiness/js/libs/zh.js"></script>
    <script type="text/javascript" src="~/assets/js/pages/widgets.js"></script>
}
